package com.easy.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.easy.bean.Member;
import com.easy.service.MemberService;
import com.easy.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("member")
@CrossOrigin
public class MemberController {

@Autowired
    MemberService memberService;
@GetMapping("list")
    public Result getList(){
        List<Member> list=memberService.list();
        return Result.success(list);
    }
    @GetMapping("page")
    public Result getPage(Page page){
       IPage result= memberService.page(page);
       return Result.success(result);
    }




}
